<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Create Companies</title>
	<f:metadata>
		  <f:viewParam name="init" value="#{createCompanyBean.viewParameterInit}"/>
	</f:metadata>
</h:head>

<h:body>

	<h:form prependId="false">

		<p:messages id="messages" showDetail="true" autoUpdate="true" />
		
		<div style="margin-left: auto; margin-right:auto;">
		<p:panel id="mainPanel" header="Please provide company details" style="width:50%; min-width:300px; max-width:500px; margin-bottom:50px;" styleClass="noBorderGrid">
			
			<p:panelGrid columns="2" style="margin-top:10px;">

				<h:outputLabel for="companyCode" value="Company Code"/>
				<p:inputText id="companyCode" value="#{createCompanyBean.company.companyCode}" required="true" style="width:150px;"/>

				<h:outputLabel for="companyName" value="Company Name"/>
				<p:inputText id="companyName" value="#{createCompanyBean.company.companyName}" required="true" style="width:150px;"/>

				<h:outputLabel for="companyCity" value="Company City"/>
				<p:inputText id="companyCity" value="#{createCompanyBean.company.companyCity}" required="true" style="width:150px;"/>

				<h:outputLabel for="companyCountry" value="Company Country"/>
				<p:selectOneMenu id="companyCountry" value="#{createCompanyBean.company.companyCountry}" required="true" style="width:158px;">
						<f:selectItem itemLabel="Select One" itemValue="" />  
            			<f:selectItem itemLabel="United States" itemValue="United States" />  
            			<f:selectItem itemLabel="Canada" itemValue="Canada" />  
            			<f:selectItem itemLabel="Mexico" itemValue="Mexico" /> 
				</p:selectOneMenu>

			</p:panelGrid>

			<br />

			<p:commandButton value="Create Company" action="#{createCompanyBean.createCompany}" update="mainPanel"/>

			<br />
			<br />

		</p:panel>
		</div>
		
	</h:form>
</h:body>
</html>